package com.taotao.rest.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.taotao.rest.service.ItemCatService;
import com.taotao.rest.pojo.CatResult;
import com.taotao.utils.JsonUtils;

@RestController
public class ItemCatController {
// http://127.0.0.1:8081/rest/itemcat/all?callback=category.getDataService 0 ()
	@Autowired
	private ItemCatService itemCatService;
	@RequestMapping(value="/itemcat/all",produces=MediaType.APPLICATION_JSON_VALUE + ";charset=utf-8")
	public  String getItemCatList(String callback){
		CatResult result=itemCatService.getItemCatList();
		String json=JsonUtils.objectToJson(result);
		return callback+"("+json+");";
	}
}
